package a.f.e;

import a.c.d;
import a.c.z;
import a.d.n;
import a.d.t;
import a.d.v;
import a.d.w;
import a.d.x;
import a.f.*;

import java.util.HashMap;
import java.util.Map;

import a.c.z;

class l
  implements gd
{
  static final double a = 15.0D;
  static final double b = 100.0D;
  private double c = 3.0D;
  private double d = 1.5D;
  private double e = 1.0D;
  private double f = 2.0D;
  private double g = 1.0D;
  private double h = 1.0D;
  private double i = 1.0D;
  private double j = 0.1D;
  private Map k = new HashMap();
  private Map l = new HashMap();
  private double[] m;
  private double[] n;
  private double o = b(paramArrayOfg);
  private double[] p;
  private double[] q;
  private gd r;
  private static final double s = 100.0D;
  
  public double a()
  {
    return this.j;
  }
  
  public void a(double paramDouble)
  {
    int i2 = a.B;
    int i1 = a.A;
    if (i2 == 0) {
      if (paramDouble < 0.0D)
      {
        this.j = 0.0D;
        if ((i2 == 0) && (i1 == 0)) {
          return;
        }
      }
    }
    if (i2 == 0)
    {
      if (paramDouble > 1.0D)
      {
        if (i2 != 0) {
          break label61;
        }
        this.j = 1.0D;
      }
    }
    else if (i1 == 0) {
      return;
    }
    label61:
    this.j = paramDouble;
  }
  
  public l(g[] paramArrayOfg, a.f.o paramo)
  {
    int i1 = a(paramArrayOfg);
    this.m = new double[i1];
    this.n = new double[i1];
    this.p = new double[i1];
    this.q = new double[i1];
    a(paramArrayOfg, paramo);
  }
  
  public double c()
  {
    return this.c;
  }
  
  public void b(double paramDouble)
  {
    this.c = paramDouble;
  }
  
  public double e()
  {
    return this.h;
  }
  
  public void c(double paramDouble)
  {
    this.h = paramDouble;
  }
  
  public double f()
  {
    return this.d;
  }
  
  public void d(double paramDouble)
  {
    this.d = paramDouble;
  }
  
  public double h()
  {
    return this.e;
  }
  
  public void e(double paramDouble)
  {
    this.e = paramDouble;
  }
  
  public double j()
  {
    return this.f;
  }
  
  public void g(double paramDouble)
  {
    this.f = paramDouble;
  }
  
  public double k()
  {
    return this.g;
  }
  
  public void h(double paramDouble)
  {
    this.g = paramDouble;
  }
  
  public double l()
  {
    return this.i;
  }
  
  public void i(double paramDouble)
  {
    this.i = paramDouble;
  }
  
  public double a(fc paramfc)
  {
    int i2 = a.B;
    double d1 = this.c + this.d + this.g + this.f + this.e + this.h + this.i;
    if (i2 == 0) {
      if (d1 == 0.0D) {
        return 0.0D;
      }
    }
    double d2 = paramfc.b() * this.i;
    int i1 = ((Integer)this.k.get(paramfc)).intValue();
    d2 += this.q[i1] * this.g;
    d2 += this.p[i1] * this.h;
    double d3 = 0.0D;
    if ((paramfc.o() > 0.0D) || (i2 == 0)) {}
    d3 = this.n[i1] > 1.0D ? 0.0D : 1.0D - this.n[i1];
    d2 += d3 * this.d;
    if ((paramfc.n() > 0.0D) || (i2 == 0)) {}
    d3 = this.m[i1] > 1.0D ? 0.0D : 1.0D - this.m[i1];
    d2 += d3 * this.c;
    g localg = (g)this.l.get(paramfc);
    d3 = 1.0D / localg.b().size();
    d2 += d3 * this.f;
    d3 = paramfc.j().h() * paramfc.j().g() / this.o;
    d2 += d3 * this.e;
    double d4 = d2 / d1;
    if ((i2 != 0) || (this.r != null))
    {
      if (i2 != 0) {
        break label360;
      }
      if (this.j > 0.0D) {
        d4 = this.r.a(paramfc) * this.j + d4 * (1.0D - this.j);
      }
    }
    label360:
    return d4;
  }
  
  String c(fc paramfc)
  {
    int i2 = a.B;
    double d1 = this.c + this.d + this.g + this.f + this.e + this.h;
    if (d1 == 0.0D) {
      return "-";
    }
    StringBuffer localStringBuffer = new StringBuffer();
    double d2 = 0.0D;
    int i1 = ((Integer)this.k.get(paramfc)).intValue();
    d2 += this.q[i1] * this.g;
    localStringBuffer.append(this.q[i1] + "; ");
    d2 += this.p[i1] * this.h;
    localStringBuffer.append(this.p[i1] + "; ");
    double d3 = 0.0D;
    if ((paramfc.o() > 0.0D) || (i2 == 0)) {}
    d3 = this.n[i1] > 1.0D ? 0.0D : 1.0D - this.n[i1];
    localStringBuffer.append(d3 + "; ");
    d2 += d3 * this.d;
    if ((paramfc.n() > 0.0D) || (i2 == 0)) {}
    d3 = this.m[i1] > 1.0D ? 0.0D : 1.0D - this.m[i1];
    localStringBuffer.append(d3 + "; ");
    d2 += d3 * this.c;
    g localg = (g)this.l.get(paramfc);
    d3 = 1.0D / localg.b().size();
    localStringBuffer.append(d3 + "; ");
    d2 += d3 * this.f;
    d3 = paramfc.j().h() * paramfc.j().g() / this.o;
    localStringBuffer.append(d3 + "; ");
    d2 += d3 * this.e;
    double d4 = d2 / d1;
    if (i2 == 0)
    {
      if ((this.r != null) && ((i2 != 0) || (this.j > 0.0D)))
      {
        d4 = this.r.a(paramfc) * this.j + d4 * (1.0D - this.j);
        localStringBuffer.append(" (" + this.r.a(paramfc) + "); ");
      }
      localStringBuffer.append(" -> " + d4);
    }
    return localStringBuffer.toString();
  }
  
  private double a(a.f.o paramo, fc paramfc)
  {
    int i3 = a.B;
    int i2 = a.A;
    ic localic = paramfc.k();
    if ((localic instanceof wb))
    {
      w[] arrayOfw = a.d.o.a(paramfc.j());
      double d1 = 1.7976931348623157E+308D;
      d locald = a(localic, paramo);
      a.d.y localy = paramo.n(locald);
      x localx = localy.b();
      w localw = localx.a();
      localx.f();
      label150:
      do
      {
        if (!localx.e()) {
          break;
        }
        n localn = new n(localw, localx.a());
        int i1 = 0;
        do
        {
          do
          {
            if (i1 >= arrayOfw.length) {
              break label150;
            }
            d3 = e.a(localn, arrayOfw[i1]);
            if (i2 != 0) {
              break;
            }
            if (d3 < d1) {
              d1 = d3;
            }
            i1++;
          } while (i2 == 0);
          localw = localx.a();
          localx.f();
        } while (i3 != 0);
      } while (i2 == 0);
      double d2 = Math.max(0.0D, ((wb)localic).b().h());
      double d3 = Math.abs(d1 - d2);
      if (i3 == 0) {
        if (d3 > 100.0D) {
          return 0.0D;
        }
      }
      return 1.0D - d3 / 100.0D;
    }
    return 0.0D;
  }
  
  private double a(a.f.o paramo, d paramd)
  {
    int i2 = a.B;
    int i1 = a.A;
    a.d.y localy = paramo.n(paramd);
    double d1 = 0.0D;
    v localv = localy.l();
    do
    {
      if (!localv.e()) {
        break;
      }
      n localn = localv.a();
      if (i2 == 0)
      {
        if (i1 != 0) {
          break label78;
        }
        d1 += localn.h();
        localv.f();
      }
    } while (i1 == 0);
    label78:
    return d1;
  }
  
  private static d a(ic paramic, a.f.o paramo)
  {
    return paramo.a((wb)paramic);
  }
  
  private double c(a.f.o paramo, fc paramfc)
  {
    int i2 = a.B;
    ic localic = paramfc.k();
    if ((i2 != 0) || ((localic instanceof wb)))
    {
      wb localwb = (wb)localic;
      fd localfd = localwb.b();
      if (((i2 == 0) && ((localfd.j()) && ((i2 == 0) && ((localfd.k()) && ((i2 == 0) && (localfd.l())))))) || (((i2 != 0) || (!localfd.j())) && ((i2 != 0) || ((!localfd.k()) && (!localfd.l()))))) {
        return 1.0D;
      }
      double d1 = 1.0D;
      d locald = a(localic, paramo);
      double d2 = a(paramo, locald);
      double d3 = Math.max(0.0D, ((wb)localic).b().h());
      double d4 = 15.0D + d3;
      double d5 = Math.max(100.0D, d2 * 0.2D);
      a.d.o localo = paramfc.j();
      Object localObject;
      double d6;
      if (i2 == 0) {
        if (localfd.j())
        {
          localObject = paramo.v(locald.e());
          d6 = e.a((t)localObject, localo);
          if (i2 == 0) {
            if (d6 <= d4) {
              return 1.0D;
            }
          }
          if (i2 != 0) {
            break label253;
          }
          if (d6 < d5) {
            d1 *= d6 / d5;
          }
        }
      }
      label253:
      if (i2 == 0) {
        if (localfd.l())
        {
          localObject = paramo.v(locald.f());
          d6 = e.a((t)localObject, localo);
          if (i2 == 0) {
            if (d6 <= d4) {
              return 1.0D;
            }
          }
          if (i2 != 0) {
            break label324;
          }
          if (d6 < d5) {
            d1 *= d6 / d5;
          }
        }
      }
      if (localfd.k())
      {
        label324:
        localObject = paramo.n(locald);
        int i1 = (int)Math.floor((((a.d.y)localObject).j() - 1) * 0.5D);
        n localn = ((a.d.y)localObject).a(i1);
        w localw = w.d(localn.d(), localn.e());
        double d7 = e.a(localo, localw);
        d1 *= d7 / d5;
      }
      return 1.0D - d1;
    }
    return 0.0D;
  }
  
  private void a(g[] paramArrayOfg, a.f.o paramo)
  {
    int i4 = a.B;
    int i3 = a.A;
    int i1 = 0;
    label132:
    label134:
    do
    {
      if (i1 >= paramArrayOfg.length) {
        break;
      }
      g localg = paramArrayOfg[i1];
      a.c.y localy = localg.b().h();
      do
      {
        if (!localy.e()) {
          break;
        }
        fc localfc = (fc)localy.j();
        int i2 = ((Integer)this.k.get(localfc)).intValue();
        this.p[i2] = a(paramo, localfc);
        this.q[i2] = c(paramo, localfc);
        localy.f();
        if (i4 != 0) {
          break label134;
        }
        if (i3 != 0) {
          break label132;
        }
      } while (i3 == 0);
      if (i4 == 0) {
        i1++;
      }
    } while (i3 == 0);
  }
  
  private int a(g[] paramArrayOfg)
  {
    int i4 = a.B;
    int i3 = a.A;
    int i1 = 0;
    int i2 = 0;
    label124:
    label126:
    do
    {
      do
      {
        if (i2 >= paramArrayOfg.length) {
          break;
        }
        g localg = paramArrayOfg[i2];
        a.c.y localy = localg.b().h();
        do
        {
          if (!localy.e()) {
            break;
          }
          fc localfc = (fc)localy.j();
          this.k.put(localfc, new Integer(i1++));
          this.l.put(localfc, localg);
          localy.f();
          if (i4 != 0) {
            break label126;
          }
          if (i3 != 0) {
            break label124;
          }
        } while (i3 == 0);
        if (i4 == 0) {
          i2++;
        }
      } while (i3 == 0);
    } while (i4 != 0);
    return i1;
  }
  
  void a(fc paramfc, a.c.e parame, t paramt)
  {
    int i1 = ((Integer)this.k.get(paramfc)).intValue();
    double d1 = m.a(paramfc.j(), paramt);
    this.m[i1] += d1;
  }
  
  void a(fc paramfc, d paramd, n paramn)
  {
    int i2 = a.B;
    int i1 = ((Integer)this.k.get(paramfc)).intValue();
    double d1 = m.a(paramfc.j(), paramn);
    if (i2 == 0)
    {
      if ((paramfc.k() != null) && ((i2 != 0) || ((paramfc.k() instanceof wb))))
      {
        wb localwb = (wb)paramfc.k();
        if (i2 != 0) {
          return;
        }
        if ((paramd.c() != null) && ((i2 != 0) || ((paramd.c() instanceof a.f.o))))
        {
          a.f.o localo = (a.f.o)paramd.c();
          d locald = localo.a(localwb);
          if (i2 != 0) {
            return;
          }
          if (paramd.equals(locald)) {
            d1 /= 2.0D;
          }
        }
      }
      this.n[i1] += d1;
    }
  }
  
  private double b(g[] paramArrayOfg)
  {
    int i3 = a.B;
    int i2 = a.A;
    double d1 = 0.0D;
    int i1 = 0;
    do
    {
      if (i1 >= paramArrayOfg.length) {
        break;
      }
      z localz = paramArrayOfg[i1].b();
      if (i3 == 0)
      {
        if (!localz.isEmpty())
        {
          fc localfc = (fc)localz.a();
          double d2 = localfc.j().h() * localfc.j().g();
          if (i3 != 0) {
            continue;
          }
          if (d2 > d1) {
            d1 = d2;
          }
        }
        i1++;
      }
    } while (i2 == 0);
    return d1;
  }
  
  public void a(gd paramgd)
  {
    this.r = paramgd;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.e.l

 * JD-Core Version:    0.7.0.1

 */